<template>
    <main>
        <ul class="header_ul">
            <li v-for="(item,index) in img" class="header_li" :class="[header_li+index, {current:num==index}]" @click="change(index)">
                <!-- {{item.con}} -->
            </li>
        </ul>
        <ul class="list" v-for="(item,index) in list">
            <li class="list_img"><img :src="item.pic" alt=""></li>
            <ul class="list_ul">
                <li class="list_li" v-for="(item,index) in item.msg">
                    <div class="img"><img :src="item.src" alt=""></div>
                    <div class='ico'><img :src="item.ico" alt=""></div>
                    <div>
                        <div class="span">
                            {{item.span}}
                        </div>
                        <div class="button">
                            进入专场
                        </div>
                    </div>
                </li>
            </ul>
        </ul>
    </main>
</template>
<script>
    export default {
        data(){
            return {
                num:0,
                header_li:'header_li',
                current:'current',
                img:[],
                list:[]
            }
        },
        mounted(){
            this.$http.get('./data/al.json',{
                
            })
            .then((response)=> {
                console.log(response);
                this.img=response.data.img
                this.list=response.data.list
            })
            .catch(function (error) {
                console.log(error);
            })
            .then(function () {
                // always executed
            }); 
        },
        methods:{
            change(a){
                this.num=a
            }
        }
    }
</script>
<style scoped>
    .header_ul{
        width: 100vw;
        height: 16vw;
    }
    .header_li{
        float: left;
        width: 20vw;
        height: 16vw;
        background-image: url('../assets/images/al/list/37cb447775e18c613e033c57d4e60eb5.jpg');
        background-size: 500% 200%;
    }
    .header_li0{
        background-position: 0 0;
    }
    .header_li1{
        background-position: -100% 0;
    }
    .header_li2{
        background-position: -200% 0;
    }
    .header_li3{
        background-position: -300% 0;
    }
    .header_li4{
        background-position: -400% 0;
    }
    .current{
        background-position-y: -100%;
    }
    .list{
        width: 100vw;
    }
    .list_img{
        width: 100vw;
        height: 12.8vw;
    }
    .list_img>img{
        width: 100%;
    }
    .list_ul{
        padding: 0 1vw;
        background-color: #f5ecdb;
    }
    .list_ul::after{
        content: "";
        display: table;
        clear: both;
    }
    .list_li{
        position: relative;
        float: left;
        width: 50%;
        padding:1vw;
    }
    .img{
        width:47vw;
        height: 43.40764vw;
    }
    .img>img{
        width:100%;
        border-radius: 1vw 1vw 0 0;
    }
    .ico{
        position: absolute;
        width: 22vw;
        height: 12vw;
        padding: 1vw 2vw;
        top: 36.5vw;
        left: 14vw;
        background-color: #fafafa;
        border: 1px solid #dadada;
    }
    .ico>img{
        width: 18vw;
        height: 9vw;
    }
    .list_li>div:nth-of-type(3){
        padding: 5vw 3vw 3vw;
        background-color: #fff;
    }
    .span{
        text-align: center;
        height: 12vw;
        font-size: 4vw;
    }
    .button{
        text-align: center;
        width: 100%;
        font-size: 4vw;
        height: 8vw;
        line-height: 8vw;
        background-color: #9d6f39;
        color: #fff;
        margin-top: 3vw;
    }
</style>